﻿using SqlSugar;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Qy.Scenario;
[SugarTable(DbTableName.OasDocCat)]
public class DocCat : ICategoryEntity
{
    [SugarColumn(IsPrimaryKey = true)]
    public int Id { get; set; }
    public int Pid { get; set; }
    public string Name { get; set; }
    public int Type { get; set; }
    public string ObjectId1 { get; set; }
    public string Ico { get; set; }
    public string ObjectId2 { get; set; }
    public int Sort { get; set; }
    public bool Status { get; set; }

}

public class EditDocCat
{
    public int Id { get; set; }
    [Display(Name = "上级类别")]
    public int Pid { get; set; }
    [Display(Name = "类别名称")]
    public string Name { get; set; }
    [Display(Name = "类别类型")]
    public int Type { get; set; }
    [Display(Name = "对象标识")]
    public string ObjectId1 { get; set; }
    [Display(Name = "对象标识2")]
    public string ObjectId2 { get; set; }
    [Display(Name = "类别图标")]
    public string Ico { get; set; }
    [RegularExpression(RegxPatterns.Number, ErrorMessage = "{0}必须为数字")]
    [Display(Name = "排序")]
    public int Sort { get; set; } = 0;
    [Display(Name = "显示条数")]
    public bool Status { get; set; }
}


public class ViewDocCat
{
    public int Id { get; set; }
    public int Pid { get; set; }
    public string Title { get; set; }
    public int Type { get; set; }
    public string ObjectId1 { get; set; }
    public string Ico { get; set; }
    public string ObjectId2 { get; set; }
    public int Sort { get; set; }
    public bool Status { get; set; }
    public int Depth { get; set; }
    public string Spread { get; set; }
    public string Disabled { get; set; }
    public int ChildrenCount { get; set; }
    public bool HaveChild { get; set; }
    public bool Open { get; set; }
    public List<ViewDocCat> Children { set; get; } = new();


}